import Vue from 'vue'
import Router from 'vue-router'
import Admin from '@/components/Admin.vue'
import CMSServer from '@/components/systemSetting/CMSServer.vue'
import HDRServer from '@/components/systemSetting/HDRServer.vue'
import RMSServer from '@/components/systemSetting/RMSServer.vue'
import DBServer from '@/components/systemSetting/DBServer.vue'
import PlatManage from '@/components/resourceManage/platManage/PlatManage.vue'
import AddPlat from '@/components/resourceManage/platManage/AddPlat.vue'
import GroupManage from '@/components/resourceManage/groupManage/GroupManage.vue'
import AddGroup from '@/components/resourceManage/groupManage/AddGroup.vue'
import PermissionManage from '@/components/userManage/permissionManage/PermissionManage.vue'
import AddPermission from '@/components/userManage/permissionManage/AddPermission.vue'
import RoleManage from '@/components/userManage/roleManage/RoleManage.vue'
import AddRole from '@/components/userManage/roleManage/AddRole.vue'
import UserManage from '@/components/userManage/userManage/UserManage.vue'
import AddUser from '@/components/userManage/userManage/AddUser.vue'
import DeviceManage from '@/components/resourceManage/deviceManage/DeviceManage.vue'
import Login from '@/components/Login.vue'
import Index from '@/components/Index.vue'
import PlanTask from '@/components/planTask/PlanTask.vue'
import AddPlan from '@/components/planTask/AddPlan.vue'
import SystemLog from '@/components/systemLog/SystemLog.vue'
import PersonalCenter from '@/components/personalCenter/PersonalCenter.vue'
import ChangePwd from '@/components/personalCenter/ChangePwd.vue'
import ChangeInfo from '@/components/personalCenter/ChangeInfo.vue'
import AddCamera from '@/components/resourceManage/deviceManage/AddCamera.vue'
import AddCameraOnvif from '@/components/resourceManage/deviceManage/addCamera/AddCameraOnvif.vue'
import AddCameraIp from '@/components/resourceManage/deviceManage/addCamera/AddCameraIp.vue'
import AddCameraManual from '@/components/resourceManage/deviceManage/addCamera/AddCameraManual.vue'
import AddCameraConfig from '@/components/resourceManage/deviceManage/addCamera/AddCameraConfig.vue'

Vue.use(Router)

export default new Router({
  routes: [
    {
      // name: 'Admin',
      path: '/',
      component: Admin,
      children: [
        { name: 'Index', path: '', component: Index },
        { name: 'CMSServer', path: 'systemSetting/cmsServer', component: CMSServer },
        { name: 'HDRServer', path: 'systemSetting/hdrServer', component: HDRServer },
        { name: 'RMSServer', path: 'systemSetting/rmsServer', component: RMSServer },
        { name: 'DBServer', path: 'systemSetting/dbServer', component: DBServer },
        { name: 'PlatManage', path: 'resourceManage/platManage', component: PlatManage },
        { name: 'AddPlat', path: 'resourceManage/platManage/:method/:platId', component: AddPlat },
        { name: 'GroupManage', path: 'resourceManage/groupManage', component: GroupManage },
        { name: 'AddGroup', path: 'resourceManage/groupManage/:method/:groupId', component: AddGroup },
        { name: 'PermissionManage', path: 'userManage/permissionManage', component: PermissionManage },
        { name: 'AddPermission', path: 'userManage/permissionManage/:method/:privilegeId', component: AddPermission },
        { name: 'RoleManage', path: 'userManage/roleManage', component: RoleManage },
        { name: 'AddRole', path: 'userManage/roleManage/:method/:roleId', component: AddRole },
        { name: 'UserManage', path: 'userManage/userManage', component: UserManage },
        { name: 'AddUser', path: 'userManage/userManage/:method/:userId', component: AddUser },
        { name: 'DeviceManage', path: 'resourceManage/deviceManage', component: DeviceManage },
        { name: 'PlanTask', path: 'planTask', component: PlanTask },
        { name: 'AddPlan', path: 'planTask/:method/:planId', component: AddPlan },
        { name: 'SystemLog', path: 'systemLog/systemLog', component: SystemLog },
        { name: 'PersonalCenter', path: 'personalCenter', component: PersonalCenter },
        { name: 'ChangePwd', path: 'personalCenter/changePwd', component: ChangePwd },
        { name: 'ChangeInfo', path: 'personalCenter/changeInfo', component: ChangeInfo },
        {
          path: '/deviceManage/deviceManage/addCamera/',
          component: AddCamera,
          children: [
            { name: 'AddCameraOnvif', path: 'onvif', component: AddCameraOnvif },
            { name: 'AddCameraIp', path: 'ip', component: AddCameraIp },
            { name: 'AddCameraManual', path: 'manual', component: AddCameraManual },
            { name: 'AddCameraConfig', path: 'config', component: AddCameraConfig }
          ]
        }
      ]
    },
    { name: 'Login', path: '/Login', component: Login }
  ]
})
